﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="PowerToolsWeb.Admin.ProductList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>产品列表</title>
    <link type="text/css" rel="Stylesheet" href="../Style/admin.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div class="DivTitle" style="vertical-align: bottom">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td align="left">
                        <img alt="" src="../Style/admin/tb.gif" width="14" height="14" /><span id="spannal"
                            runat="server">产品列表</span>
                    </td>
                </tr>
            </table>
        </div>
        <div class="divcon">
            &nbsp;<asp:DropDownList ID="ddlType" runat="server">
            </asp:DropDownList>
            &nbsp;
            <asp:TextBox ID="txbProductName" runat="server" CssClass="BigInput"></asp:TextBox>
            &nbsp;<asp:Button ID="Button2" runat="server" Text="查 询" CssClass="button_bg2" OnClick="Button2_Click" />
        </div>
        <asp:GridView ID="GridView1" Width="100%" runat="server" AutoGenerateColumns="False"
            CssClass="GridView" DataKeyNames="PRODUCTID" OnRowDataBound="GridView1_RowDataBound"
            AllowPaging="true" PageSize="11" 
            onpageindexchanging="GridView1_PageIndexChanging" 
            onrowcommand="GridView1_RowCommand">
            <PagerStyle CssClass="pager" HorizontalAlign="Center" VerticalAlign="Middle"/>
            <Columns>
                <asp:TemplateField HeaderText="商品图片" ItemStyle-Width="130">
                    <ItemTemplate>
                        <img src='<%#Eval("PICURL","../{0}") %>' class="imgpic" alt='<%#Eval("PRODUCTNAME") %>'
                            style="width: 60px; height: 40px" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="商品名称" DataField="PRODUCTNAME" ItemStyle-Width="160">
                </asp:BoundField>
                <asp:BoundField HeaderText="所属类别" DataField="TypeName" ItemStyle-Width="120"></asp:BoundField>
                <asp:BoundField HeaderText="是否推荐" DataField="ISRECOMMEND" ItemStyle-Width="100">
                </asp:BoundField>
                <asp:BoundField HeaderText="备注" DataField="remark" ItemStyle-HorizontalAlign="Left">
                </asp:BoundField>
                <asp:TemplateField HeaderText="操作" ItemStyle-Width="130">
                    <ItemTemplate>
                        <img src="../Style/admin/edit.gif" width="10" height="10" alt="" />
                        <a href='AddProduct.aspx?pid=<%#Eval("PRODUCTID") %>'>编辑</a> &nbsp;&nbsp;|&nbsp;&nbsp;
                        <img src="../Style/admin/del.gif" width="10" height="10" alt="" />
                        <asp:LinkButton ID="lbDelete" runat="server" CommandArgument='<%#Eval("PRODUCTID") %>'
                            CommandName="DeleteProduct" OnClientClick="return confirm('你确认删除该商品？');">删除</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    </form>
</body>
</html>
